package ru.ifmo;

/**
 * Created by Admin on 13.02.15.
 */
public class KPUpdateDataThread extends Thread {
    private final SmartSpaceKP kp;
    private SmartSpaceTriplet data;
    private SmartSpaceTriplet oldData;

    public KPUpdateDataThread(SmartSpaceKP kp, SmartSpaceTriplet data, SmartSpaceTriplet oldData) {
        this.kp = kp;
        this.data = data;
        this.oldData = oldData;
    }

    @Override
    public void run() {
        synchronized (kp) {
            try {
                kp.updateData(data, oldData);
            } catch (SmartSpaceException e) {
                e.printStackTrace();
            }
        }
    }
}
